﻿/* 
*  冰火家族萬能NPC
* 
* 
* 
* 
* 
*/ 
var x = "#fEffect/CharacterEff/1112949/0/0#";//高音譜記號 
var kk = "#fEffect/BasicEff/MainNotice/Boss/Default/0#";//BOSS 
var c = "#fEffect/CharacterEff/1032063/0/0#";//"#fUI/UIMiniGame/starPlanetRPS/heart#";//愛心 
var cmark = "#fUI/UIPVP/ChampionMark/1#";//愛心 
var lb = "#fEffect/ItemEff/1112811/0/0#";//藍色小光 
var b = "#fEffect/CharacterEff/Shaman/1#";//超萌熊熊 
var cat = "#fEffect/CharacterEff/Shaman/4#";//超萌喵咪 
var leaf = "#fUI/Basic.img/Cursor/18/0#"; 
var status; 
var sele;
 
var menuList = Array( 
        Array(lb, "我的帳號", 0, true), 
    Array(lb, "美容中心", 1, true), 
    Array(lb, "萌獸系統", 2, true), 
    Array(lb, "成就系統", 3, true), 
    Array(lb, "每日任務", 4, true), 
    Array(lb, "角色轉職", 5, true),
	Array(lb, "技能點滿", 6, true)
    ); 
function start() { 
    status = -1; 
    action(1, 0, 0); 
} 
 
function action(mode, type, selection) { 
 
    if (mode == 0) { 
  cm.dispose(); 
  return; 
    } else if (mode == 1){ 
  status++; 
    } else { 
  status--; 
    } 
 
    switch (status) { 
        case 0:  
      text = "\t  "+c+"#fn华文行楷##fs30##e#k #b角色相關 " +c+ "\r\n#fs12##fn宋体#"; 
       
      var ccc = 0; 
      for (var i = 0; i < menuList.length; i++) { 
        if(ccc%3 == 0) 
          text +="\r\n   "; 
        if (menuList[i][3]) { // 如果允许显示 
          text += "#d#L" + menuList[i][2] + "#" + menuList[i][0] + menuList[i][1] + "#l"; 
          ccc++; 
        } 
      } 
      text += "\r\n\r\n\t\t   #L999#" + leaf +"#fn华文行楷##fs22##e#r回上一頁#l" 
      text += "\r\n\r\n  " +c+c+c+c+c+c; 
      cm.sendSimple(text); 
            break; 
        case 1: // 
			sele = selection
		  switch (selection){ 
			case 0://我的帳號 
			  cm.dispose(); 
			  cm.openNpc(2084001, "My_Account"); 
			  return; 
			case 1://美容中心 
			  cm.dispose(); 
			  cm.openNpc(2084001, "hair_cut"); 
			  return; 
			case 2://怪怪系統 
			  cm.dispose(); 
			  cm.openUI(0x254); 
			  return;
			case 3://成就系統 
			  cm.dispose(); 
			  cm.openNpc(2084001, "Achievements");
			  return;
			case 4://每日任務 
				text = '請選擇以下服務:';
				text += '#b\r\n#L0#上個月累積簽到獎勵#l';
				text += '\r\n#L1#本月簽到獎勵#l';
				text += '\r\n#L2#本月累積簽到獎勵#l';
				text += '\r\n#L3#在線獎勵#l';
				cm.sendSimple(text);
				break; 
			case 5://轉職 
			  cm.dispose(); 
			  cm.openNpc(9010000, "changeJob"); 
			  return;
			case 6://技能點滿			
			  cm.maxSkillsByJob();
			  cm.dispose();
			  return;
			case 999://回上一頁 
			  cm.dispose(); 
			  cm.openNpc(1052253); 
			  return;
		  } 
          break;
		case 2:
			switch(sele){
				case 4:
					switch(selection){
						case 0:
							cm.dispose(); 
							cm.openNpc(2008, 998); 
							break;
						case 1:
							cm.dispose(); 
							cm.openNpc(2008, 999); 
							break;
						case 2:
							cm.dispose(); 
							cm.openNpc(2008, 1000); 
							break;
						case 3:
							cm.dispose(); 
							cm.openNpc(9010000, "Onlinebonus"); 
							break;
					}
					break;
				default: 
				  cm.sendOk("發生錯誤，請聯繫管理員!"); 
				  cm.dispose(); 
				  return;
			}
			break;
        default: 
      cm.sendOk("發生錯誤，請聯繫管理員!"); 
      cm.dispose(); 
      break; 
    } 
} 